from django.db import models


# Create your models here.
class Author(models.Model):
    name = models.CharField('姓名:', max_length=50, unique=True)

    def __str__(self):
        return f"{self.id}-{self.name}"


class Wife(models.Model):
    name = models.CharField('姓名:', max_length=50, unique=True)
    author = models.OneToOneField(Author, on_delete=models.CASCADE)

    def __str__(self):
        return f"{self.id}-{self.name}"
